﻿CREATE TABLE [dbo].[payments] (
    [ID]             INT             IDENTITY (1, 1) NOT NULL,
    [CustomerID]     INT             NOT NULL,
    [Money]          DECIMAL (18, 5) NOT NULL,
    [Description]    VARCHAR (500)   NOT NULL,
    [Balance]        DECIMAL (18, 5) NOT NULL,
    [NoteDate]       DATETIME        NOT NULL,
    [CreatedOn]      DATETIME        NOT NULL,
    [OperatorUserID] INT             NOT NULL,
    [OrderNo]        VARCHAR (20)    NOT NULL,
    [Method]         INT             CONSTRAINT [DF__payments__Method__2B3F6F97] DEFAULT ('1') NOT NULL,
    CONSTRAINT [PK__payments__3214EC2729572725] PRIMARY KEY CLUSTERED ([ID] ASC),
    CONSTRAINT [FK_payments_customers] FOREIGN KEY ([CustomerID]) REFERENCES [dbo].[customers] ([ID]),
    CONSTRAINT [FK_payments_users] FOREIGN KEY ([OperatorUserID]) REFERENCES [dbo].[users] ([ID])
);



